package pcloud.client.worker;

import java.io.File;
import java.io.IOException;

import pcloud.client.util.FileResourceInfo;

public class UploadTask extends CloudTask
{

	FileResourceInfo remoteFileInfo;
	File localFile;

	public UploadTask(FileResourceInfo fileInfo)
	{
		super(fileInfo);
		remoteFileInfo = fileInfo.toRemote();
	}

	@Override
	public boolean doWork() throws IOException
	{
		return fileService.uploadFile(remoteFileInfo.getFullPath(),
				fileInfo.getFullPath());
	}

	@Override
	protected boolean inTaskTriggerAfterDoWork()
	{
		return true;
	}

	@Override
	protected boolean inTaskTriggerBeforeDoWork()
	{
		return true;
	}

}
